package com.wt.单例模式;

/**
 * 饿汉式
 */
public class Single3 {
    private static Single3 single;
    private Single3(){}
    public static synchronized Single3 getSingle(){
        if(single == null){
           synchronized (Single3.class) {
               if (single == null) {
                   single = new Single3();
               }
           }
        }
        return single;
    }
}
